import json

from core.ResultBase import Result_Response
from utils.log_util import logger


def process_response(response):
    if response.status_code == 200 or response.status_code == 201:
        Result_Response.success = True
        Result_Response.body = response.json()

        # logger.info("\n接口的返回内容>>>\n{}".format(json.dumps(response.json(), ensure_ascii=False, indent=2)))
    else:
        Result_Response.success = False
        logger.info("\n接口状态吗不是’2XX‘，请检查")

    logger.info("\n接口的返回内容>>>\n{}".format(json.dumps(response.json(), ensure_ascii=False, indent=2)))
    return Result_Response